package com.example.enterprise.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
@ApiModel("用户实体")
public class User {
  @ApiModelProperty (value = "用户名",example = "kate")
  @Size(min = 6,max = 10,message = "用户名必须6~8位")
  private String username;
  @ApiModelProperty (value = "用户居住地址",example = "马栏山")
  @NotNull(message = "用户住址不能为空")
  private String address;

  @DecimalMin(value = "1", message = "年龄输入不正确")
  @DecimalMax(value = "200",message = "年龄输入不正确")
  private Integer age;

  @Email(message = "邮箱格式不正确")
  @NotNull(message = "邮箱不能为空")
  private String email;
  //省略 getter/setter

}